﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyWebCom
{
    class Program
    {
        static void Main(string[] args)
        {
            //测试一次
            MyTestCom myTestCom = new MyTestCom();
            myTestCom.OnPushData += MyTestCom_OnPushData;// 注册数据推送事件
            myTestCom.Init(1,9600, "{interval:100,dataBits:0,parity:0}");
            myTestCom.Open();
            Console.ReadLine();
        }

        private static void MyTestCom_OnPushData(string id, dynamic data)
        {
            Console.WriteLine("接收到数据："+data);
        }
    }
}
